const Controller = require('egg').Controller;

class HomeController extends Controller {
  async index() {
    this.ctx.body = 'Hello world';
    const ctx = this.ctx;
    const { username, age } = {username:'name',age:10};
    const user = await ctx.model.User.findOne({ where: {username:'name'} });
    const accessToken = await ctx.model.AccessToken.create({id: 'AccessToken1',expiresAt: new Date(),scope: 'scope',clientId: 'clientId31',userId: 1});
    ctx.status = 201;
    ctx.body = accessToken;
  }
}

module.exports = HomeController;